home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / OpenGL / glfragmentlight.z / glfragmentlight
Encoding:
Text File  |  2001-04-17  |  22.1 KB  |  331 lines

  1.  
  2.  
  3.  
  4. ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))            OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee            ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttffffSSSSGGGGIIIIXXXX,,,, ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttiiiiSSSSGGGGIIIIXXXX,,,, ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttffffvvvvSSSSGGGGIIIIXXXX,,,,
  10.      ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttiiiivvvvSSSSGGGGIIIIXXXX - set fragment light source parameters
  11.  
  12.  
  13. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  14.      void ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttffffSSSSGGGGIIIIXXXX( GLenum _l_i_g_h_t,
  15.                                 GLenum _p_n_a_m_e,
  16.                                 GLfloat _p_a_r_a_m )
  17.      void ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttiiiiSSSSGGGGIIIIXXXX( GLenum _l_i_g_h_t,
  18.                                 GLenum _p_n_a_m_e,
  19.                                 GLint _p_a_r_a_m )
  20.  
  21.  
  22. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  23.      _l_i_g_h_t   Specifies a fragment light.  The number of fragment lights
  24.              depends on the implementation.  They are identified by names of
  25.              the form GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTi____SSSSGGGGIIIIXXXX where 0 _< i <
  26.              GGGGLLLL____MMMMAAAAXXXX____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTSSSS____SSSSGGGGIIIIXXXX.
  27.  
  28.      _p_n_a_m_e   Specifies a single-valued fragment light source parameter for
  29.              _l_i_g_h_t.  GGGGLLLL____SSSSPPPPOOOOTTTT____EEEEXXXXPPPPOOOONNNNEEEENNNNTTTT, GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF,
  30.              GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN, GGGGLLLL____LLLLIIIINNNNEEEEAAAARRRR____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN, and
  31.              GGGGLLLL____QQQQUUUUAAAADDDDRRRRAAAATTTTIIIICCCC____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN are accepted.
  32.  
  33.      _p_a_r_a_m   Specifies the value that parameter _p_n_a_m_e of fragment light source
  34.              _l_i_g_h_t will be set to.
  35.  
  36. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  37.      void ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttffffvvvvSSSSGGGGIIIIXXXX( GLenum _l_i_g_h_t,
  38.                                  GLenum _p_n_a_m_e,
  39.                                  const GLfloat *_p_a_r_a_m_s )
  40.      void ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttiiiivvvvSSSSGGGGIIIIXXXX( GLenum _l_i_g_h_t,
  41.                                  GLenum _p_n_a_m_e,
  42.                                  const GLint *_p_a_r_a_m_s )
  43.  
  44.  
  45. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  46.      _l_i_g_h_t
  47.           Specifies a fragment light.  The number of fragment lights depends
  48.           on the implementation.  They are identified by names of the form
  49.           GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTi____SSSSGGGGIIIIXXXX where 0 _< i < GGGGLLLL____MMMMAAAAXXXX____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTSSSS____SSSSGGGGIIIIXXXX.
  50.  
  51.      _p_n_a_m_e
  52.           Specifies a fragment light source parameter for _l_i_g_h_t.  GGGGLLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT,
  53.           GGGGLLLL____DDDDIIIIFFFFFFFFUUUUSSSSEEEE, GGGGLLLL____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR, GGGGLLLL____PPPPOOOOSSSSIIIITTTTIIIIOOOONNNN, GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF,
  54.           GGGGLLLL____SSSSPPPPOOOOTTTT____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN, GGGGLLLL____SSSSPPPPOOOOTTTT____EEEEXXXXPPPPOOOONNNNEEEENNNNTTTT, GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN,
  55.           GGGGLLLL____LLLLIIIINNNNEEEEAAAARRRR____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN, and GGGGLLLL____QQQQUUUUAAAADDDDRRRRAAAATTTTIIIICCCC____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN are accepted.
  56.  
  57.      _p_a_r_a_m_s
  58.           Specifies a pointer to the value or values that parameter _p_n_a_m_e of
  59.           fragment light source _l_i_g_h_t will be set to.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))            OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee            ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))
  71.  
  72.  
  73.  
  74. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  75.      ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt sets the values of individual fragment light source
  76.      parameters.  _l_i_g_h_t names the fragment light and is a symbolic name of the
  77.      form GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTi____SSSSGGGGIIIIXXXX, where 0 _< i < GGGGLLLL____MMMMAAAAXXXX____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTSSSS____SSSSGGGGIIIIXXXX.
  78.      _p_n_a_m_e specifies one of ten fragment light source parameters, again by
  79.      symbolic name.  _p_a_r_a_m_s is either a single value or a pointer to an array
  80.      that contains the new values.
  81.  
  82.      To enable and disable fragment lighting calculation, call ggggllllEEEEnnnnaaaabbbblllleeee and
  83.      ggggllllDDDDiiiissssaaaabbbblllleeee with argument GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTIIIINNNNGGGG____SSSSGGGGIIIIXXXX. Fragment lighting is
  84.      initially disabled.  When it is enabled, light sources that are enabled
  85.      contribute to the fragment lighting calculation.  Fragment light source i
  86.      is enabled and disabled using ggggllllEEEEnnnnaaaabbbblllleeee and ggggllllDDDDiiiissssaaaabbbblllleeee with argument
  87.      GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTi____SSSSGGGGIIIIXXXX.
  88.  
  89.      The ten fragment light parameters are as follows:
  90.  
  91.      GGGGLLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT          _p_a_r_a_m_s contains four integer or floating-point values
  92.                          that specify the ambient RGBA intensity of the
  93.                          fragment light.  Integer values are mapped linearly
  94.                          such that the most positive representable value maps
  95.                          to 1.0, and the most negative representable value
  96.                          maps to -1.0.  Floating-point values are mapped
  97.                          directly.  Neither integer nor floating-point values
  98.                          are clamped.  The initial ambient fragment light
  99.                          intensity is (0, 0, 0, 1).
  100.  
  101.      GGGGLLLL____DDDDIIIIFFFFFFFFUUUUSSSSEEEE          _p_a_r_a_m_s contains four integer or floating-point values
  102.                          that specify the diffuse RGBA intensity of the
  103.                          fragment light.  Integer values are mapped linearly
  104.                          such that the most positive representable value maps
  105.                          to 1.0, and the most negative representable value
  106.                          maps to -1.0.  Floating-point values are mapped
  107.                          directly.  Neither integer nor floating-point values
  108.                          are clamped.  The initial value for
  109.                          GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTT0000____SSSSGGGGIIIIXXXX is (1, 1, 1, 1); for other
  110.                          fragment lights, the initial value is (0, 0, 0, 0).
  111.  
  112.      GGGGLLLL____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR         _p_a_r_a_m_s contains four integer or floating-point values
  113.                          that specify the specular RGBA intensity of the
  114.                          fragment light.  Integer values are mapped linearly
  115.                          such that the most positive representable value maps
  116.                          to 1.0, and the most negative representable value
  117.                          maps to -1.0.  Floating-point values are mapped
  118.                          directly.  Neither integer nor floating-point values
  119.                          are clamped.  The initial value for
  120.                          GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTT0000____SSSSGGGGIIIIXXXX is (1, 1, 1, 1); for other
  121.                          fragment lights, the initial value is (0, 0, 0, 0).
  122.  
  123.      GGGGLLLL____PPPPOOOOSSSSIIIITTTTIIIIOOOONNNN         _p_a_r_a_m_s contains four integer or floating-point values
  124.                          that specify the position of the fragment light in
  125.                          homogeneous object coordinates.  Both integer and
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))            OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee            ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))
  137.  
  138.  
  139.  
  140.                          floating-point values are mapped directly.  Neither
  141.                          integer nor floating-point values are clamped.
  142.  
  143.                          The position is transformed by the modelview matrix
  144.                          when ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt is called (just as if it were a
  145.                          point), and it is stored in eye coordinates.  If the
  146.                          w component of the position is 0, the fragment light
  147.                          is treated as a directional source.  Diffuse and
  148.                          specular fragment lighting calculations take the
  149.                          light's direction, but not its actual position, into
  150.                          account, and attenuation is disabled.  Otherwise,
  151.                          diffuse and specular fragment lighting calculations
  152.                          are based on the actual location of the fragment
  153.                          light in eye coordinates, and attenuation is enabled.
  154.                          The initial position is (0, 0, 1, 0); thus, the
  155.                          initial fragment light source is directional,
  156.                          parallel to, and in the direction of the -z axis.
  157.  
  158.      GGGGLLLL____SSSSPPPPOOOOTTTT____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN   _p_a_r_a_m_s contains three integer or floating-point
  159.                          values that specify the direction of the fragment
  160.                          light in homogeneous object coordinates.  Both
  161.                          integer and floating-point values are mapped
  162.                          directly.  Neither integer nor floating-point values
  163.                          are clamped.
  164.  
  165.                          The spot direction is transformed by the inverse of
  166.                          the modelview matrix when ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt is called
  167.                          (just as if it were a normal), and it is stored in
  168.                          eye coordinates.  It is significant only when
  169.                          GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF is not 180, which it is initially.
  170.                          The initial direction is (0, 0, -1).
  171.  
  172.      GGGGLLLL____SSSSPPPPOOOOTTTT____EEEEXXXXPPPPOOOONNNNEEEENNNNTTTT    _p_a_r_a_m_s is a single integer or floating-point value
  173.                          that specifies the intensity distribution of the
  174.                          fragment light.  Integer and floating-point values
  175.                          are mapped directly.  Only values in the range
  176.                          [0,128] are accepted.
  177.  
  178.                          Effective fragment light intensity is attenuated by
  179.                          the cosine of the angle between the direction of the
  180.                          fragment light and the direction from the fragment
  181.                          light to the vertex being lighted, raised to the
  182.                          power of the spot exponent.  Thus, higher spot
  183.                          exponents result in a more focused fragment light
  184.                          source, regardless of the spot cutoff angle (see
  185.                          GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF, next paragraph).  The initial spot
  186.                          exponent is 0, resulting in uniform fragment light
  187.                          distribution.
  188.  
  189.      GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF      _p_a_r_a_m_s is a single integer or floating-point value
  190.                          that specifies the maximum spread angle of a fragment
  191.                          light source.  Integer and floating-point values are
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))            OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee            ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))
  203.  
  204.  
  205.  
  206.                          mapped directly.  Only values in the range [0,90] and
  207.                          the special value 180 are accepted.  If the angle
  208.                          between the direction of the fragment light and the
  209.                          direction from the light to the vertex being lighted
  210.                          is greater than the spot cutoff angle, the fragment
  211.                          light is completely masked.  Otherwise, its intensity
  212.                          is controlled by the spot exponent and the
  213.                          attenuation factors.  The initial spot cutoff is 180,
  214.                          resulting in uniform fragment light distribution.
  215.  
  216.      GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN
  217.  
  218.      GGGGLLLL____LLLLIIIINNNNEEEEAAAARRRR____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN
  219.  
  220.      GGGGLLLL____QQQQUUUUAAAADDDDRRRRAAAATTTTIIIICCCC____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN
  221.                          _p_a_r_a_m_s is a single integer or floating-point value
  222.                          that specifies one of the three fragment light
  223.                          attenuation factors.  Integer and floating-point
  224.                          values are mapped directly.  Only nonnegative values
  225.                          are accepted.  If the fragment light is positional,
  226.                          rather than directional, its intensity is attenuated
  227.                          by the reciprocal of the sum of the constant factor,
  228.                          the linear factor times the distance between the
  229.                          fragment light and the vertex being lighted, and the
  230.                          quadratic factor times the square of the same
  231.                          distance.  The initial attenuation factors are (1, 0,
  232.                          0), resulting in no attenuation.
  233.  
  234. NNNNOOOOTTTTEEEESSSS
  235.      It is always the case that GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTi____SSSSGGGGIIIIXXXX =
  236.      GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTT0000____SSSSGGGGIIIIXXXX + i.
  237.  
  238. EEEERRRRRRRROOOORRRRSSSS
  239.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if either _l_i_g_h_t or _p_n_a_m_e is not an accepted
  240.      value.
  241.  
  242.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if a spot exponent value is specified
  243.      outside the range [0,128], or if spot cutoff is specified outside the
  244.      range [0,90] (except for the special value 180), or if a negative
  245.      attenuation factor is specified.
  246.  
  247.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt is executed between
  248.      the execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.
  249.  
  250. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  251.      ggggllllGGGGeeeettttFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt
  252.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____FFFFRRRRAAAAGGGGMMMMEEEENNNNTTTT____LLLLIIIIGGGGHHHHTTTTIIIINNNNGGGG____SSSSGGGGIIIIXXXX
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))            OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee            ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhtttt((((3333GGGG))))
  269.  
  270.  
  271.  
  272. MACHINE DEPENDENCIES
  273.      The SSSSGGGGIIIIXXXX____ffffrrrraaaaggggmmmmeeeennnntttt____lllliiiigggghhhhttttiiiinnnngggg extension is supported only on OOOOccccttttaaaannnneeee2222 VVVVPPPPrrrroooo
  274.      systems.
  275.  
  276.      On OOOOccccttttaaaannnneeee2222 VVVVPPPPrrrroooo systems, use of the texture q coordinate to achieve
  277.      projective texture effects will be processed on a per-vertex basis
  278.      instead of a per-pixel basis, unless the the texture matrix is set up to
  279.      be projective.  (A projective texture matrix is defined to be one in
  280.      which any of the 13th, 14th or 15th elements is non-zero.)  In addition,
  281.      if either two-sided lighting or fragment lighting is in effect,
  282.      projective texture effects will always be processed on a per-vertex
  283.      basis.
  284.  
  285.  
  286. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  287.      ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttCCCCoooolllloooorrrrMMMMaaaatttteeeerrrriiiiaaaallll, ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttLLLLiiiigggghhhhttttMMMMooooddddeeeellll, ggggllllFFFFrrrraaaaggggmmmmeeeennnnttttMMMMaaaatttteeeerrrriiiiaaaallll
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.